package my.soft.aiteacher.teacher.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import my.soft.aiteacher.teacher.pojo.KeypointItemVO;
import my.soft.aiteacher.teacher.pojo.KeypointVO;
import my.soft.aiteacher.teacher.service.IKeyPointService;
import my.soft.aiteacher.utils.R;
import org.springframework.web.bind.annotation.*;

@Tag(name="教师-视频节点题目管理",description="教师-视频节点题目管理")
@RestController
public class KeyPointController {
    @Resource
    private IKeyPointService questionnaireService;
    @Operation(summary = "提交视频节点题目",description = "提交视频节点题目")
    @RequestMapping(value = "/submitKeypoint",method = RequestMethod.POST)
    public R submitQuestionnaire(@RequestBody KeypointVO keypointVO){
        questionnaireService.submitQuestionnaire(keypointVO);
        return R.success("ok");
    }
    @Operation(summary = "查询视频节点题目",description = "查询视频节点题目")
    @RequestMapping(value = "/Keypoint/{fileId}",method = RequestMethod.GET)
    public R queryQuestionnaire(@PathVariable Long fileId){
        KeypointVO keypointVO = questionnaireService.queryQuestionnaire(fileId);
        return R.success(keypointVO);
    }
    @Operation(summary = "删除视频节点题目",description = "删除视频节点题目")
    @RequestMapping(value = "/deleteKeypoint/{id}",method = RequestMethod.POST)
    public R deleteKeypoint(@PathVariable Long id){
        questionnaireService.deleteKeypoint(id);
        return R.success("ok");
    }
    @Operation(summary = "修改视频节点题目",description = "删除视频节点题目")
    @RequestMapping(value = "/updateKeypoint",method = RequestMethod.POST)
    public R updateKeypoint(@RequestBody KeypointItemVO keypointItemVO){
        questionnaireService.updatekeypoint(keypointItemVO);
        return R.success("ok");
    }


}
